import request from '@u/request'

export function getBuildingInfo(buildCode) {
  return request({
    url: `/topic/new/build/get?buildCode=${buildCode}`,
    method: 'get',
  })
}

export function addOrUpdateBuilding(data) {
  return request({
    url: '/topic/new/build/addOrUpdate',
    method: 'post',
    data,
  })
}

export function queryByResidenceId(residenceId) {
  return request({
    url: `/topic/new/build/queryByResidenceId?residenceId=${residenceId}`,
    method: 'get',
  })
}

export function queryNewBuild(params) {
  return request({
    url: '/topic/new/build/query',
    method: 'get',
    params,
  })
}

export function queryPoint(params) {
  return request({
    url: '/topic/new/point/query',
    method: 'get',
    params,
  })
}

export function getPoint(pkid) {
  return request({
    url: `/topic/new/point/get?pkid=${pkid}`,
    method: 'get',
  })
}

export function deletePoint(pkid) {
  return request({
    url: `/topic/new/point/delete?pkid=${pkid}`,
    method: 'get',
  })
}

export function addOrUpdatePoint(data) {
  return request({
    url: '/topic/new/point/addOrUpdate',
    method: 'post',
    data,
  })
}

export function getTotal() {
  return request({
    url: '/topic/new/build/total',
    method: 'get',
  })
}

export function getPointTotal() {
  return request({
    url: '/topic/new/point/total',
    method: 'get',
  })
}
